import request from '../../utils/request'


// 根据分类id查询参数列表详细
export function getTimeZoneInfo(parameter_id) {
  return request({
    url: '/parameter/parameters/' + parameter_id + '/values',
    method: 'get'
  })
}

export function getParameterByCategoryId(category_id) {
  return request({
    url: '/parameter/category/' + category_id,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function getAllParameters() {
  return request({
    url: '/parameter/parameters',
    method: 'get',
  })
}

export function addParameter(data) {
  return request({
    url: '/parameter/parameters/',
    method: 'post',
    data: data
  })
}

// 
export function addSimulation(data) {
  return request({
    url: '/env-parameter',
    method: 'post',
    data: data
  })
}

// 获取所有分类
export function getAllCategory() {
  return request({
    url: '/env-parameter/categories',
    method: 'get'
  })
}

// export function getParameterByCategoryId(data) {
//   return request({
//     url: '/parameter/category/ ' + data,
//     method: 'get',
//   })
// }

export function exportEnvByIds(ids){
  return request({
    url: '/parameter/parameters/detail/export_by_ids',
    method: 'post',
    data: ids,
    responseType: 'blob' // 设置响应类型为blob
  })
}


export function batchDeleteByIds(ids){
  return request({
    url: '/parameter/parameters/batch',
    method: 'delete',
    data: ids
  })
}

export function getParameterRecord(){
  return request({
    url: '/env-parameter/',
    method: 'get',
  })
}
export function deleteParameterRecord(id){
  return request({
    url: '/env-parameter/' + id,
    method: 'delete',
  })
}